/*
 * JaCoLiB
 * Copyright (C) 2008 Alessandro Serra
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */

package it.gashale.jacolib.shell;

import it.gashale.jacolib.core.EvalError;
import it.gashale.jacolib.core.JacolibError;
import it.gashale.jacolib.rpc.RPCClient;
import it.gashale.jacolib.rpc.RPCClientStub;

public class RemoteShell extends RPCClient implements ShellInterface {
	
	public RemoteShell(RPCClientStub rpc_client) throws JacolibError {
		super(rpc_client);
	}
	public String hello() throws JacolibError {
		return (String)exec("shell-hello");
	}
	public String getLanguageName() throws JacolibError {
		return (String)exec("shell-language-name");
	}
	public Object eval(String code) throws EvalError, JacolibError {
		return exec("shell-eval", code);
	}
	public Object get(String key) throws EvalError, JacolibError {
		return exec("shell-get",key);
	}
	public Object source(String filename) throws EvalError, JacolibError {
		return exec("shell-source",filename);
	}
	public void set(String key, Object obj) throws EvalError, JacolibError {
		exec("shell-set",key,obj);
	}
	public void unset(String key) throws EvalError, JacolibError {
		exec("shell-unset",key);
	}
	public void quit() throws JacolibError {
		super.quit();
	}
}
